import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path'
import viteCompression from 'vite-plugin-compression'
// https://vite.dev/config/
export default defineConfig({
  plugins: [react(),viteCompression({
    verbose:true,
    disable:false,
    threshold:1025,
    algorithm:'gzip',
    ext:'.gz'
  })],
  resolve: {
    alias: {
      "@": path.resolve(__dirname, '/src'),
    },
  },
  server: {
    proxy: {
      '/api': {
        target: 'http://113.44.139.133:8005',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, ''),
      },
    }}
})
